<html lang="en">
<head>
    <title>游记评论管理</title>
<#include "../common/header.ftl">

    <link href="/js/plugins/jqPaginator/jqPagination.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/plugins/jqPaginator/jq-paginator.min.js"></script>

    <script type="text/javascript">
        $(function () {
            //编辑/添加
            $(".inputBtn").click(function () {
                //弹出模态框
                $("#editModal").modal("show");

                $("#treeview").html("");
                //数据复原
                $("#editForm").clearForm(true);

                //目的地回显数据
                var data = $(this).data("json");
                if (data) {
                    $("input[name='id']").val(data.id);

                    $("textarea[name='info']").val(data.info);

                }
            });

            $(".submitBtn").click(function () {
                //模态框表单提交
                $("#editForm").ajaxSubmit(function (data) {
                    if (data.success) {
                        window.location.reload();
                    } else {
                        $.messager.alert("温馨提示", data.msg)
                    }
                })
            });

            //查询
            $(".clickBtn").click(function () {
                var parentId = $(this).data("parentid");
                $("#parentId").val(parentId);
                $("#currentPage").val(1);
                $("#searchForm").submit();
            });

            //修改热门
            $(".hotBtn").click(function () {
                var hot = $(this).data("hot");
                var id = $(this).data("id");
                $.get("/destination/changeHotValue", {hot: hot, id: id}, function (data) {
                    if (data.success) {
                        window.location.reload();
                    } else {
                        $.messager.alert("温馨提示", data.msg);
                    }
                })
            })
        })
    </script>


</head>
<body>
<!--左侧菜单回显变量设置-->
<#assign currentMenu="TravelComment">

<div class="container-fluid " style="margin-top: 20px">
<#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-2">
        <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-10">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">游记评论管理</h1>
                </div>
            </div>
        <#setting number_format="#">
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/travelComment/list" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <input type="hidden" name="parentId" id="parentId" value="${qo.parentId!}">
            </form>

            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>标题</th>
                    <th>用户名</th>
                    <th>评论内容</th>
                    <th>点赞数</th>
                    <th>操作</th>
                </tr>
                </thead>
            <#list pageInfo.content as entity>
                <tr>
                    <td>${entity_index+1}</td>
                    <td>${entity.detailTitle!}</td>
                    <td>${entity.username!}</td>
                    <td>${(entity.content)!"顶级"}</td>
                    <td>${(entity.thumbupnum)!}</td>

                    <td>
                        <a class="btn btn-primary btn-xs hotBtn" href="JavaScript:;" data-hot="1"
                           data-id="${entity.id}">
                            <span class="glyphicon glyphicon-tag"></span>审核
                        </a>

                        <a href="javascript:;" class="btn btn-info btn-xs deleteBtn"
                           data-url="/destination/delete?id=${entity.id}">
                            <span class="glyphicon glyphicon-th"></span> 查看
                        </a>
                        <a href="javascript:;" class="btn btn-danger btn-xs deleteBtn"
                           data-url="/destination/delete?id=${entity.id}">
                            <span class="glyphicon glyphicon-trash"></span> 删除
                        </a>
                    </td>
                </tr>
            </#list>
            </table>
        <#--分页-->
        <#include "../common/page2.ftl"/>
        </div>
    </div>
</div>

</body>
</html>